<?php
include_once 'header.php'; 
$users_info = $pdo->query("select count(*) from yunbbs_articles");
foreach ($users_info as $key1 => $count) {
    $bbs_id = $count['count(*)'];
}
$user_info = $pdo->query("select * from yunbbs_articles where id='$bbs_id'");
foreach ($user_info as $key1 => $value1) {
    print_r($value1);
}
?>
<style>
    #body{
        width: 100%;
        display: flex;
        background-color: #ededed;
    }
    #list_left {
        display: flex;
        width: 70%;
        flex-direction: column;
        align-items: flex-end;
    }
    td {
        /*border:1px solid red;*/
    }
    #bbs_list {
        width: 95%;
        /*border: 1px solid blue;*/
        background-color:white;

    }
    #bbs_re {
        width: 95%;
        /*border: 1px solid blue;*/
        background-color:white;

    }
    #list_right {
        width: 30%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #bbs_right {
        width: 80%;
        /*border: 1px solid blue;*/
        /*display: flex;*/
        background-color:white;
    }
    .message3 {
        margin: 10px 5px;
        width: 70px;
        border: 1px solid #bbb7bb;
    }
    .message2 {
        margin: 10px 5px;
        width: 45px;
        border: 1px solid #bbb7bb;
    }
</style>
<div id="list_left">
    <div style="height:30px; width: 100%;"></div>
    <div id="bbs_list">
        <div style="height:40px; background-color:#b0b0b0;">
            <span style="line-height:40px; float:left; margin-left: 15px;">mybbs >> 默认分类(1)</span>
            <span style="line-height:40px; float:right; margin-right: 15px;"><a href="posting.php">+发新帖</a></span>
        </div>
        <div>
            <table style="width:100%;">
                <tr>
                    <td style="width:80%;"><h2 style=" float:left; margin-left: 15px;">今天星期二</h2></td>
                    <td rowspan="2" style="width:20%;"><img src="image/1.png" style="width:50px; height:50px;"></td>
                </tr>
                <tr>
                    <td><p style="float:left; margin-left: 15px;">By <?php echo $name; ?> at 2 秒前·1点击·回复·收藏</p></td>
                </tr>
                <tr>
                    <td colspan="2"><p style="float:left; margin-left: 15px;">哈哈</p></td>
                </tr>
            </table>
        </div>
    </div>
    
    <div style="height:50px; width: 100%;"></div>
    
    <div id="bbs_re">
        <div style="height:40px; background-color:#b0b0b0;">
            <span style="line-height:40px; float:left; margin-left: 15px;">添加一条新回复</span>
            <span style="line-height:40px; float:right; margin-right: 15px;"><a href="#">↑回到顶部</a></span>
        </div>
        <div>
            <form method="post" action="doaction.php" id="bbs_re">
                <table style="width:100%; margin-left: 20px;">
                    <tr>
                        <td colspan="2"><textarea form="bbs_re" style="width:99%;height: 300px; margin: 10px 0;"></textarea></td>
                    </tr>
                    <tr>
                        <td style="width:64%;"></td>
                        <td style="font-size:12px; color: #acabab;">上传附件<input  style="font-size:12px; width: 150px" type="file" name="file"></td>
                    </tr>
                    <tr>
                        <td style="height:50px;"><input type="submit" name="submit" value="提交"></td>
                        <td style="font-size:12px; color: #acabab; text-align: right;">请尽量让自己的回复对别人有帮助</td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<div id="list_right">
    <div style="height:30px; width: 100%;"></div>
    <div id="bbs_right">
        <div style="height:40px; background-color:#b0b0b0;">
            <span style="line-height:40px; float:left; margin-left: 15px;">最近添加的分类</span>
        </div>
        <div>
            <div style="display: flex;">
                <?php foreach ($yunbbs_categories as $key => $value) { ?>
                    <div class="message3"><a href="#"><?php echo $value['name'] ?></a></div>
                    <?php }
                    ?>
            </div>
        </div>
    </div>
    <div style="height:20px; width: 100%;"></div>
    <div id="bbs_right">
        <div style="height:40px; background-color:#b0b0b0;">
            <span style="line-height:40px; float:left; margin-left: 15px;">链接</span>
        </div>
        <div>
            <div class="message2">
                <a href="index.php">MyBBS</a>
            </div>
        </div>
    </div>
</div>

<?php
include_once 'footer.php';
?>

